package com.superlinh.torus;

import android.opengl.GLSurfaceView.Renderer;
import android.opengl.GLES20;
import javax.microedition.khronos.opengles.GL10;
import javax.microedition.khronos.egl.EGLConfig;

public class MyRenderer implements Renderer
{
	private native void onUpdate();
	private native void onResize(int width, int height);
	
	public void onSurfaceCreated(GL10 unused, EGLConfig config)
	{
		GLES20.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
	}
	
	public void onDrawFrame(GL10 unused)
	{
		GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
		onUpdate();
	}
	
	public void onSurfaceChanged(GL10 unused, int width, int height)
	{
		onResize(width, height);
	}
}